Isaku Yamahata [Wed, 24 Dec 2008 03:50:55 +0000 (12:50 +0900)]
[IA64]: fix compilation error.
BUILD_BUG_ON() was changed so that now BUILD_BUG_ON() can't be
used with symbol values.
Fortunately dom_fpswa_hypercall_patch() isn't performance critical
so replace BUILD_BUG_ON() with BUG_ON().
Fixed the wrong condition which has off-by-one bug.
Isaku Yamahata [Fri, 12 Dec 2008 01:36:23 +0000 (10:36 +0900)]
IA64: fix panic caused by daccess fault.
While fpswa emulation, Xen VMM access guest virtual address space
which may cause daccess fault resulting in panic.
This patch make daccess fault handler handle such cases properly.
Isaku Yamahata [Fri, 12 Dec 2008 01:35:58 +0000 (10:35 +0900)]
IA64: make the fpswa emulation keep the previous behaviour.
When fpswa library return statue > 0, keep the previous behavior.
This case should be addressed somehow later, but it seems somewhat
difficult to resolve, so keep the previous behavor for now.
It is assumed that a guest kernel calls fpswa library
without preemption. This assumption breaks if a guest kernel is
preemptive.
Isaku Yamahata [Fri, 12 Dec 2008 01:34:18 +0000 (10:34 +0900)]
IA64: fix fp fault/trap handler.
This patch is a part of fixes to bug reported as
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1392
When fpswa handler fails to get a bundle in guest,
fp fault/trap should be injected into the guest and let a guest
to handle it.
When the fpswa library return a error, there is no way to
pass the value to the guest. In that case, just inject fpswa
fault/trap into a guest running a risk that guest may get
error with their own fpswa call. Here it is assumed that
no applications depend on SIGFP process signal to recover
their computation.
Isaku Yamahata [Fri, 12 Dec 2008 01:29:15 +0000 (10:29 +0900)]
IA64: fix emulation of fp emulation in pv domain
This patch is a part of fixes to bug reported as
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1392
When vmm fails to get a bundle in a question during fpswa processing,
there is no way, but a guest provides the bundle.
On the other hand the current implementation just returns random value.
This patch make the fpswa hypercall calling convention complicated and
pass necessary informations to the hypervisor.
Keir Fraser [Thu, 4 Dec 2008 14:12:08 +0000 (14:12 +0000)]
Fix one timer range issue
According to the timer sematic, the timer can be executed at any timer
within [expires, expires_end], however, current implementation only allow
timer to be executed after expires_end, which is not conform to the timer
semantics.
This patch fix the the SPECpower score regression (~5% downgrade)
introduced by changeset 18744 "Change timer implementation to allow
variable 'slop'"
Keir Fraser [Thu, 4 Dec 2008 11:36:18 +0000 (11:36 +0000)]
Fix existence check for MMIO-mapped 16550 UARTs
Changeset 982e6fce0e47 added an existence test for UARTs.
Unfortunately, the existence test happens before MMIO UARTs are
ioremapped, therefore it may not be probing where it thinks it's
probing. Rather than moving more code around, I think it's probably
safe to assume the arch code knows what it's doing if it passes in an
MMIO UART.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Keir Fraser [Thu, 4 Dec 2008 11:31:37 +0000 (11:31 +0000)]
xend: Remember bootloader settings in xenstore
When xend is restarted, bootloader settings of all running domains are
lost. The attached patches fixes this by saving bootloader and
bootloader_args to xenstore database.
Keir Fraser [Wed, 3 Dec 2008 15:55:32 +0000 (15:55 +0000)]
AMD IOMMU: Fix event log interrupt handling
Reset EventLogInt bit in iommu status register(MMIO offset 2020h) in
event log interrupt handler, to show software has handled the
interrupt. Completion wait interrupt is disabled.
Keir Fraser [Wed, 3 Dec 2008 11:44:47 +0000 (11:44 +0000)]
physdev: make PHYSDEVOP_pirq_eoi_mfn use of gmfn instead of mfn.
To pass a page from a guest to hypervisor, gmfn should be used
instead of mfn like grant table and other hypercalls. It's more
consistent. So make use of gmfn instead of mfn for
PHYSDEVOP_pirq_eoi_mfn hypercall.
Itanium processors can handle some misaligned data accesses. They
also provide a mode where all such accesses are forced to trap. The
kernel was schizophrenic about use of this mode:
* Base kernel code ran in permissive mode where the only traps
generated were from those cases that the h/w could not handle.
* Interrupt, syscall and trap code ran in strict mode where all
unaligned accesses caused traps to the 0x5a00 unaligned reference
vector.
Use strict alignment checking throughout the kernel, but make
sure that we continue to let user mode use more relaxed mode
as the default.
Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Keir Fraser [Tue, 2 Dec 2008 11:53:24 +0000 (11:53 +0000)]
Fix Xen panic with oprofile
The attached patch fixes a Xen panic when a domain is shutdown before
oprofile is stopped. Without this patch, free_xenoprof_pages() is
called before the domain is destroyed and that, in turn, prevents
oprofile from cleaning up pages shared with guests. Shutting down a
domain without terminating oprofile therefore causes a Xen panic at a
later point in time.
Keir Fraser [Fri, 28 Nov 2008 13:27:32 +0000 (13:27 +0000)]
x86: add a shared page indicating the need for an EOI notification
To simplify the interface for the guest, when a guest uses this new
(sub-)hypercall, PHYSDEVOP_eoi behavior changes to unmask the
corresponding event channel at once, avoiding the eventual need for a
second hypercall from the guest.
Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 28 Nov 2008 13:05:58 +0000 (13:05 +0000)]
xend: Fix device release for tap devices
I saw an error message when I shut down a domain. The error
message showed that release of device(vbd/51712) failed. But the
device was tap, was not vbd. I think that a cause of the error message is
because _releaseDevices() calls destroyDevice() by wrong device class.
Keir Fraser [Fri, 28 Nov 2008 13:04:30 +0000 (13:04 +0000)]
xm: Relax the sanity check on guest configuration with XSM-ACM addlabel
The attached patch relaxes the sanity check on guest configuration
when assigning a acm label to the guest. This patch makes a guest
configuration accept a bootloader parameter. This is common for
paravirtualized guests to boot them by using pygrub.
Keir Fraser [Thu, 27 Nov 2008 16:22:14 +0000 (16:22 +0000)]
x86_emulate: Fix for test harness and simplify some opcodes.
- Need to use EFLG_DF rather than EF_DF
- No need to force EAX destination for many opcodes, as this will be
the default behaviour for DstReg with no ModRM.
Keir Fraser [Thu, 27 Nov 2008 11:22:38 +0000 (11:22 +0000)]
VT-d code cleanup
- remove a printk line. This printk may be output too many on some
platforms, thus result in hang during dom0 booting.
- add write buffer flush in domain_context_unmap_one()
- when map/unmap context, if context is not flushed, needn't to flush
iotlb
Signed-off-by: Weidong Han <weidong.han@intel.com>
Keir Fraser [Tue, 25 Nov 2008 11:17:57 +0000 (11:17 +0000)]
Fix PSE PAT handling in guest walk.
Guest walk was currently checking for _PAGE_PSE_PAT flag in
guest_l2e_get_flags(). The problem is that this function only checks
for the first 12 bits of the PDE, while _PAGE_PSE_PAT is actually on bit
12 (that is the 13th bit). This caused _PAGE_PAT bit to never been set on
splintered L1s.
Keir Fraser [Mon, 24 Nov 2008 11:17:44 +0000 (11:17 +0000)]
hvmloader: Relocate the etherboot ROM to be near the end of VGA
BIOS. Current Xen hard coded VGA ROM at 0xC0000 and etherboot ROM
at 0xD0000. This makes the space in [0xC0000 - 0xDFFFF] to be
fragments, which makes it hard to find enough space to hold another
Option ROM.
Keir Fraser [Mon, 24 Nov 2008 11:11:20 +0000 (11:11 +0000)]
pv-on-hvm drivers: build fixes for Linux 2.6.27+
Make the drivers build properly in a 2.6.27 environment as well as
against a kernel with pv-ops Xen configured on (in the latter case
more work would be needed to also make the drivers work, as there's a
large number of duplicate exports).
Portions from Charles Arnold <carnold@novell.com>.
Keir Fraser [Mon, 24 Nov 2008 11:06:16 +0000 (11:06 +0000)]
PCI interface changes for PCIE-AER enabling
This patch reflects some pci interface changes in pciif.h in XEN head
file. And also add domain shutdown support in xend for shutting domain
from DOM0 kernel when non-recoverable uncorrected pci error happens.
Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com> Signed-off-by: Ke Liping <liping.ke@intel.com>
Keir Fraser [Thu, 20 Nov 2008 14:23:59 +0000 (14:23 +0000)]
x86: make NR_IRQS build-time configurable
While keeping the NR_IRQS default at 256 here, I think it would be a
good thing to set it to a higher value to make sure no new mixing of
irq and vector spaces slip in.
Keir Fraser [Thu, 20 Nov 2008 14:22:54 +0000 (14:22 +0000)]
Properly distinguish irq and vector spaces
This makes sure that there are no assumptions about NR_IRQS==NR_VECTORS
anymore, and it also renames various variables to properly reflect
what they represent.
While coded correctly, I wonder whether dump_irqs() shouldn't iterate
over the vector space rather than the irq space, so that MSI entries
are also processed.
Keir Fraser [Thu, 20 Nov 2008 14:17:09 +0000 (14:17 +0000)]
xend: Make _setCPUAffinity() errors nonfatal on domain resume
This patch allows domains to be resumed on different number of CPUs. After
c/s 18764, a domain cannot be resumed when _setCPUAffinity() fails, which
happens when affinity should be set to a non-existent CPU. This patch
makes _setCPUAffinity() errors nonfatal.
Keir Fraser [Wed, 19 Nov 2008 13:17:31 +0000 (13:17 +0000)]
x86, s3: Sync platform stamps at time suspend.
platform_timer_stamp and stime_platform_stamp are synced
to platform timer in time calibration (1s interval), and
thus doesn't reflect the latest value. If they're not
synced at time suspend, the offset can be lost after S3
resume. Average 0.8s lag-behind is observed for each S3
action, which accumulates to TOD inaccuracy.
Keir Fraser [Tue, 18 Nov 2008 15:59:26 +0000 (15:59 +0000)]
x86, hvm: Fix domain restore bug with Intel VLAPIC acceleration.
r18383 mark video memory as ram, and make all valid pages migrated,
including vlapic page (0xFEE00), and share page(0xFFFFF).
An extra memory population for lapic page would override previous
mapping then cause HVM guest with vlapic acceleration hang.
Keir Fraser [Tue, 18 Nov 2008 11:16:36 +0000 (11:16 +0000)]
x86, hvm: Implement interrupt routing to least priority processor.
Instead of round robin the vcpu with the lowest processor
priority is selected for the interrupt. If multiple vcpus
share the same low priority then interrupts are distributed between
those round robin.
This patch removes all the useless big endian stuff from the mini-os.
Before there was an effort to support big endian for PV-guest.
But the big endian support was never gotten into the common parts of
the mini-os so it makes no sense to have this only in the ia64
specific sources. And as there is no open source big endian os and
porting our BS2000 os to ia64 was stopped, nobody wants that stuff
in the common minos.
So this looks ugly then and remove the big endian stuff.
Keir Fraser [Thu, 13 Nov 2008 16:31:08 +0000 (16:31 +0000)]
x86: don't disable MSI in order to mask an IRQ
... as that's not really correct, and there are devices which can't
even cope with that. Instead, check whether an MSI IRQ can be masked,
and if it can't, treat it just like a level triggered IO-APIC IRQ.
There's one other bug fix in here, correcting an off-by-one error on
the entry_nr range check in __pci_enable_msix().
Keir Fraser [Thu, 13 Nov 2008 13:03:16 +0000 (13:03 +0000)]
x86: Use the shadow-code PT walker from the HAP functions
Replace the guts of the HAP pagetable walker with a call to the
newly-commonified walker from the shadow code. This reduces
duplication, and gives HAP guests proper access control and A/D-bit
setting for memory accesses from the emulator
Keir Fraser [Wed, 12 Nov 2008 12:04:15 +0000 (12:04 +0000)]
x86: add SSE-based copy_page()
In top of the highmem asstance hypercalls added earlier, this provides
a performance improvement of another 12% (measured on Xeon E5345) for
the page copying case.